package cn.yy.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Cash entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cash", catalog = "phoneerp")
public class Cash implements java.io.Serializable {

	// Fields

	private Integer id;
	private Year year;
	private Month month;
	private String type;
	private Double originalAmount;
	private Double income;
	private Double expense;
	private Double finalAmount;

	// Constructors

	/** default constructor */
	public Cash() {
	}

	/** full constructor */
	public Cash(Year year, Month month, String type, Double originalAmount,
			Double income, Double expense, Double finalAmount) {
		this.year = year;
		this.month = month;
		this.type = type;
		this.originalAmount = originalAmount;
		this.income = income;
		this.expense = expense;
		this.finalAmount = finalAmount;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "yearId", nullable = false)
	public Year getYear() {
		return this.year;
	}

	public void setYear(Year year) {
		this.year = year;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "monthId", nullable = false)
	public Month getMonth() {
		return this.month;
	}

	public void setMonth(Month month) {
		this.month = month;
	}

	@Column(name = "type", nullable = false, length = 10)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "originalAmount", nullable = false, precision = 22, scale = 0)
	public Double getOriginalAmount() {
		return this.originalAmount;
	}

	public void setOriginalAmount(Double originalAmount) {
		this.originalAmount = originalAmount;
	}

	@Column(name = "income", nullable = false, precision = 22, scale = 0)
	public Double getIncome() {
		return this.income;
	}

	public void setIncome(Double income) {
		this.income = income;
	}

	@Column(name = "expense", nullable = false, precision = 22, scale = 0)
	public Double getExpense() {
		return this.expense;
	}

	public void setExpense(Double expense) {
		this.expense = expense;
	}

	@Column(name = "finalAmount", nullable = false, precision = 22, scale = 0)
	public Double getFinalAmount() {
		return this.finalAmount;
	}

	public void setFinalAmount(Double finalAmount) {
		this.finalAmount = finalAmount;
	}

}